Move the assert under the protection of the in_transaction flag.
authorEwan Mellor <ewan@xensource.com>
Wed, 29 Nov 2006 12:15:45 +0000 (12:15 +0000)
committerEwan Mellor <ewan@xensource.com>
Wed, 29 Nov 2006 12:15:45 +0000 (12:15 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/xenstore/xstransact.py

index c6a3bb9d82be1d63789bd4a6f16a67e879b79313..dd9aa9854438a44fda74bc0b7f714df4cc588eb9 100644 (file)
@@ -11,11 +11,12 @@ from xen.xend.xenstore.xsutil import xshandle
 class xstransact:
 
     def __init__(self, path = ""):
-        assert path is not None
         
         self.in_transaction = False # Set this temporarily -- if this
                                     # constructor fails, then we need to
                                     # protect __del__.
+
+        assert path is not None
         self.path = path.rstrip("/")
         self.transaction = xshandle().transaction_start()
         self.in_transaction = True